package com.yuanmeng.common.core.enums;

import lombok.Getter;

@Getter
public enum AliPayTypeEnum {
    /**
     * PC
     */
    PC("PC","FAST_INSTANT_TRADE_PAY"),
    /**
     * H5
     */
    H5("H5","QUICK_WAP_WAY"),
    /**
     * App
     */
    APP("APP","QUICK_MSECURITY_PAY");


    private String type;
    private String code;

    AliPayTypeEnum(String type, String code) {
        this.code = code;
        this.type = type;
    }

    public static String  getCode(String type) {
        for (AliPayTypeEnum payType : AliPayTypeEnum.values()) {
            if (payType.getType().equals(type)) {
                return payType.getCode();
            }
        }
        return null;
    }
}
